Install Odoo on MAC

  • Step 1:

    1. Install Git

    
                  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
                  
                  brew install git
                  

    2.Download Odoo 15 Community Edition

    create folder /Users/macbookpro/tutorials/odoo/v15/odoo-server

    navigate to /Users/macbookpro/tutorials/odoo/v15/odoo-server

    
                  git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 .
                  

    3. Install Python

    goto https://www.python.org/downloads/macos

    select Python v3.8.0

    Go at the bottom and select macOS 64-bit installer.

    check python version

    
                  python3 --version
    

    install python, pip3 for installing python packages

    check pip3 version

    
                 pip3 --version
                  

    4.Install PostgreSQL and pgAdmin 4

    goto https://www.postgresql.org/download/

    5. manage and access PostgreSQL

    install pgAdmin 4. Go to https://www.pgadmin.org/download/

    5.Install Odoo Python Dependencies

    To see all Odoo python dependencies, go inside odoo-server directory and open requirements.txt.

    To create virtual environment, first go to "/Users/macbookpro/tutorials/odoo/v15" by typing cd in terminal, then click and drag v15 folder and hit enter.

    
              python3 -m venv odoo_venv
    

    After running the above code, a new folder odoo_venv will be created.

    Next, activate the virtual environment by running the code below:

    
    source odoo_venv/bin/activate
    

    Install the python module packages by running the code below. Wait until all dependencies will be installed.

    
    pip3 install setuptools wheelpip3 install -r ./odoo-server/requirements.txt
    

    6.Install wkhtmltopdf

    Odoo uses wkhtmltopdf to print reports. This can not be installed using pip3. To download separately, go to https://wkhtmltopdf.org/downloads.html and select macOS operating system.

    7.Install NodeJS

    Odoo offer several languages including Arabic/Hebrew. To support these, we need to install rtlcss using npm. To use npm, we need to install NodeJS. Go to https://nodejs.org/en/ and download version LTS (Long Term Support).

    
    sudo npm install -g rtlcss
    

    8. Create new database user

    For security reason, we can not use default postgres user. To create a new user, open pgAdmin 4. For first time use, it might ask for password.

    Go to Servers -> Localhost and right Login/Group Roles and select Create -> Login/Group Role...

    In General, type the name. Next add the password in definition. Lastly, under privileges, toggle Can Login and Create Databases. Click Save.

    9. Install and Setup PyCharm ad Odoo Configuration

    First, create a new folder under "Users/macbookpro/tutorials/v15" and name it your_home since this will be the theme that we will create.

    Download PyCharm community edition on https://www.jetbrains.com/pycharm/download/#section=mac . Once downloaded, open PyCharm and choose Open and select the folder you created "your_home".

    By default, PyCharm will automatically create a new file main.py. Right click on the file and click delete. Inside you_home folder, create Odoo configuration by creating a new file odoo.conf. Copy and paste the following code:

    your_home/odoo.conf

    
    [options]
    admin_passwd = 12345
    db_host = False
    db_port = False
    db_user = ajs
    db_password = ajs
    dbfilter = ^your_home.*$
    db_list = True
    addons_path = /Users/macbookpro/tutorials/odoo/v15/odoo-server/addons
    http_port = 8069
    

    Add virtual environment by going in PyCharm -> Preferences -> Project -> Python Interpreter. Check the link of current python interpreter and if this is not the one you created under "Users/macbookpro/tutorial/odoo/v15/odoo_venv, then click gear icon on the right side and click Add.

    Select Existing Environment and locate python3 file which is located inside "odoo_venv/bin/python3". Click apply and okay button.

    Edit PyCharm configuration by clicking on the menu bar. By default, it will create a new configuration "main". Click main click minus (-) button on top left to delete.

    Click plus (+) button to add new and choose Python. Copy the code below for the script path and parameters. Note, replace the code based on the location of your file. Click apply and OK.

    PyCharm Configuration

    
    Script Path: /Users/macbookpro/tutorials/odoo/v15/odoo-server/odoo-bin 
    Parameters: -c "/Users/macbookpro/tutorials/odoo/v15/your_home/odoo.conf"
    

    Run Odoo by clicking green arrow in the toolbar.

    Go to the browser on type url http://localhost:8069. You will be redirected to http://localhost:8069/web/database/manager since there's no database yet created.